<%@ page import="aca.Turma" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'turma.label', default: 'Turma')}" />
		<title>Adicionar Monitor</title>
	</head>
	<body>
		<a href="#list-turma" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
		</div>
		<div id="list-turma" class="content scaffold-list" role="main">
			<g:form controller="turma" action="buscar_monitor" id="${turmaInstance.id}">
				<h1>Buscar Monitor <g:textField name="busca"/> <g:submitButton name="submit" value="Buscar"/></h1>
			</g:form>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list turma">
				<table>
					<thead>
						<tr>					
							<th>Nome</th>
							<th>Email</th>
							<th>Selecionar</th>
						</tr>
					</thead>
					<tbody>
					<g:form controller="turma" action="adicionar_monitor" id="${turmaInstance.id}">
					<g:each in="${resultList}" status="i" var="alunoInstance">
						<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
						
							<td><g:link action="show" id="${alunoInstance.id}">${fieldValue(bean: alunoInstance, field: "nome")}</g:link></td>
						
							<td>${fieldValue(bean: alunoInstance, field: "email")}</td>
							
							<td><g:checkBox name="box" value="${alunoInstance.nome};${alunoInstance.email}" checked="false" /></td>
						
						</tr>
					</g:each>
					</tbody>
				</table>
			</ol>
				<fieldset class="buttons">
  					<g:submitButton name="submit" value="Confirma"/>
  				</fieldset>
  			</g:form>
  		</div>
	</body>
</html>